#ifndef _FLASH_STORAGE_H_
#define _FLASH_STORAGE_H_

#ifdef PLATFORM_ESP32
#include "esp_vfs.h"
typedef int (*SSB_fs_list_file_cb)(struct dirent *ent, int isEnd, int numIndex);
typedef int (*SSB_fs_read_callback_fun)(char *data, int len);

void SSB_flash_list_file(SSB_fs_list_file_cb cb);
//=================vfs===============
int SSB_flash_fs_storage(char *filename, char *data, int len, int mode);
int SSB_flash_fs_rename(char *src, char *desc);

/*
*
max_byte 最大字节数
mode: 1 按行的方式读取，0按字节方式读取
*/
void SSB_flash_fs_cb_read(char *filename, int max_byte, int mode, SSB_fs_read_callback_fun cb);
void SSB_flash_fs_init();
int SSB_flash_fs_remove(char *filename);

#endif



void SSB_flash_nvs_storage(char *key, char *data, int len);
void SSB_read_data_from_nvs_flash(char *key, char *data, int maxLen);



#endif